package one.stand.feign;

import one.stand.fallback.UserFallBack;
import one.stand.model.ResultModel;
import one.stand.request.*;
import one.stand.response.BusinessCardResponse;
import one.stand.response.BusinessCardVideoResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author: QIK
 * @CreateDate: 2019/4/16 14:43
 */
@Component
@FeignClient(value = "user-service", fallback = UserFallBack.class, decode404 = true)
public interface UserFegin {

    /**
     * 创建名片
     *
     * @param request
     * @return
     */
    @PostMapping("businessCard/createCard")
    ResultModel<Boolean> createCard(@RequestBody BusinessCardRequest request);

    /**
     * 创建名片
     *
     * @param request
     * @return
     */
    @PostMapping("businessCard/isCreateCompany")
    ResultModel<Boolean> isCreateCompany(@RequestBody TokenRequest request);

    /**
     * 修改名片
     *
     * @param request
     * @return
     */
    @PostMapping("businessCard/updateCard")
    ResultModel<Boolean> updateCard(@RequestBody BusinessCardRequest request);


    /**
     * 名片详情
     *
     * @param request
     * @return
     */
    @PostMapping("businessCard/cardDetails")
    ResultModel<BusinessCardResponse> cardDetails(@RequestBody BusinessCardRequest request);


    /**
     * 查询用户自己的名片
     */
    @PostMapping("/businessCard/getUserCard")
    ResultModel getUserCard(@RequestBody BusinessCardRequest request);


    /**
     * 添加通话记录
     * @param request
     * @return
     */
    @PostMapping("businessCard/addCallsRecord")
    ResultModel addCallsRecord(@RequestBody CallsPhoneRecordRequest request);

    /**
     * 保存用户formid信息
     */
    @PostMapping("/personal/addFormId")
    ResultModel<Integer> addFormId(@RequestBody UserRequest request);

    /**
     * 得到名片二维码
     */
    @PostMapping("/businessCard/getWxTwoCode")
    ResultModel getWxTwoCode(@RequestBody BusinessCardRequest request);



    /**
     * 添加名片视频
     * @param request
     * @return
     */
    @PostMapping("businessCardVideo/addVideo")
    ResultModel<Boolean> addVideo(@RequestBody BusinessCardVideoRequest request);

    /**
     * 修改名片视频
     * @param request
     * @return
     */
    @PostMapping("businessCardVideo/uodVideo")
    ResultModel<Boolean> uodVideo(@RequestBody BusinessCardVideoRequest request);

    /**
     * 移动名片视频
     * @param request
     * @return
     */
    @PostMapping("businessCardVideo/moveVideo")
    ResultModel<Boolean> moveVideo(@RequestBody BusinessCardVideoRequest request);

    /**
     * 删除视频
     * @param request
     * @return
     */
    @PostMapping("businessCardVideo/delVideo")
    ResultModel<Boolean> delVideo(@RequestBody BusinessCardVideoRequest request);

    /**
     * 删除视频
     * @param request
     * @return
     */
    @PostMapping("businessCardVideo/moveList")
    ResultModel<List<BusinessCardVideoResponse>> moveList(@RequestBody BusinessCardVideoRequest request);
}
